<?php
class categoryDeleteAction extends sfActions
{
    public function execute($request)
    {
		$notify = "delFailed";
		
    	$cms_category_id = $request->getParameter('cms_category_id');
        $this->forward404Unless($cms_category = Doctrine_Core::getTable('VTNSCmsCategory')->findOneByCmsCategoryId($cms_category_id), sprintf('Mục này không tồn tại (%s).',$cms_category_id));
		if ($cms_category->deleteAllChildrenAndCms())
			$notify = "delSuccess";
		
      	$this->redirect('cms/categoryList?notify='.$notify);
       	//return sfView::SUCCESS;
    }
	
}
?>